MCP 101

Building the Next Generation of Context-Aware AI Agents

Skylar Payne

The Dawn of Agentic AI

From text generation to real-world action

graph TB
    A["🧠 Traditional LLM<br/>Text Generator"] 
    B["🤖 Agentic AI<br/>Action Taker"]
    
    A --> C["📝 Email Drafts"]
    A --> D["💭 Ideas"]
    
    B --> E["🔍 Research"]
    B --> F["⚙️ Tool Use"]
    B --> G["🎯 Goal Achievement"]
    
    style A fill:#f9f,stroke:#333,stroke-width:2px
    style B fill:#9f9,stroke:#333,stroke-width:2px

  • 🤖 AI agents can now reason, plan, and use tools
  • 🔬 Microsoft Discovery: AI-discovered sustainable cooling material
  • 📊 Autonomous competitive analysis in under 50 minutes
  • 🎥 HeyGen Video Agent: prompt-to-video generation

The paradigm shift: Passive content creation → Active problem-solving

The Context Gap Problem

LLMs are “incredibly smart in a vacuum” 🎈

🚧 The Challenges

  • ⏳ Knowledge Cutoff: Frozen training data
  • 🏝️ Data Silos: No access to private/real-time data
  • 🕸️ N×M Integration: Every model needs custom connections

💥 The Impact

  • 📉 80% of AI projects fail due to data access
  • 🧩 Complex “context engineering” required
  • 🔒 Vendor lock-in and brittle integrations

Integration: Before vs After MCP

Aspect Traditional (N×M) MCP Standard
Integration Effort High: Custom code for each pair Low: One server, any client
Discoverability Manual documentation reading Automated runtime reflection
Interoperability Vendor-locked Model-agnostic open standard
Security Ad-hoc API key management OAuth 2.1, scopes, consent
Scalability Poor: N×M complexity Excellent: N+M complexity

Meet MCP: The Universal Standard

Model Context Protocol - Anthropic, November 2024

Key Analogies

  • “USB-C for AI”: Universal connector for AI peripherals
  • “LSP for AI”: Like Language Server Protocol for editors

Core Benefits

  • Open, model-agnostic standard
  • Network effects: build once, use everywhere
  • Future-proof architecture

MCP Architecture

graph TD
    A[MCP Host<br/>Claude Desktop, Cursor IDE] --> B[MCP Client 1]
    A --> C[MCP Client 2]
    A --> D[MCP Client N]
    B --> E[ArXiv Server]
    C --> F[GitHub Server]
    D --> G[Database Server]
    
    style A fill:#e1f5fe
    style E fill:#f3e5f5
    style F fill:#f3e5f5
    style G fill:#f3e5f5

  • Host: User-facing application
  • Client: Manages connections (1:1 with servers)
  • Server: Exposes specific capabilities via JSON-RPC 2.0

Our Demo: AI Research Assistant

Goal: Build an agent that finds, analyzes, and manages academic papers

Implementation Plan

  1. Scaffold: Basic ArXiv search server
  2. Expand: Add Tools, Resources, and Prompts
  3. Enhance: Progress notifications and logging
  4. Secure: OAuth authentication with Zotero
  5. Advanced: Elicitation, Roots, and Sampling

Step 1: Scaffolding the ArXiv Server

Setup

uv sync

Simple Server

from mcp.server.fastmcp import FastMCP
import arxiv

mcp = FastMCP("ArXiv Research Server")

@mcp.tool()
def search_papers(query: str, max_results: int = 5):
    """Search ArXiv for scientific papers"""
    pass

Run and test: uv run uvicorn server:mcp --reload

MCP’s Three Core Primitives

Primitive Purpose Analogy Example
Tools Executable actions with side effects POST Request download_paper(paper_id)
Resources Read-only, file-like data GET Request arxiv/{paper_id}/abstract
Prompts Reusable workflow templates Workflow “Deep Paper Analysis”

Benefits: Clear separation of concerns, better security, predictable behavior

Code Demo: Complete ArXiv Server

Setup & Models

from mcp.server.fastmcp import FastMCP
import arxiv
from pydantic import BaseModel

mcp = FastMCP("ArXiv Research Server")

class Paper(BaseModel):
    title: str
    authors: list[str]
    summary: str
    pdf_url: str

Tools & Resources

@mcp.tool()
def search_papers(query: str, max_results: int = 5):
    """Search ArXiv for papers"""
    search = arxiv.Search(query=query, 
                         max_results=max_results)
    return [Paper(...) for r in search.results()]

@mcp.resource("arxiv/{paper_id}/abstract")
def get_abstract(paper_id: str) -> str:
    """Get paper abstract"""
    # Implementation here
    pass

Full implementation: See examples/arxiv-server/server.py

Enhanced UX: Progress Tracking

The Problem

  • Long-running operations leave users waiting
  • No feedback during downloads or processing
  • Poor user experience

MCP Solution

  • Built-in notification system
  • Progress tokens for tracking
  • Real-time status updates

Implementation

{
  "method": "notifications/progress",
  "params": {
    "progressToken": "download-xyz-789",
    "progress": 5,
    "total": 20,
    "message": "Downloading paper 5 of 20..."
  }
}

Security: OAuth 2.1 Authentication

Challenge: Access private Zotero library safely

Traditional OAuth Pain

  • Manual app registration
  • Copy-paste client credentials
  • N×M authentication problem

MCP Innovation

  • Dynamic Client Registration
  • Automatic endpoint discovery
  • One-click user consent
  • PKCE security protection

Result: Most secure path is also the easiest path

Authentication Flow

sequenceDiagram
    participant User
    participant Client
    participant Server
    participant Zotero
    
    User->>Client: "Save paper to Zotero"
    Client->>Server: add_paper_to_collection()
    Server-->>Client: 401 Unauthorized
    Client->>Zotero: OAuth authorization request
    Zotero->>User: Login & consent screen
    User->>Zotero: Approve access
    Zotero->>Client: Authorization code
    Client->>Zotero: Exchange for access token
    Client->>Server: Retry with Bearer token
    Server->>Client: Success!

Advanced Interactive Patterns

🗣️ Elicitation

Ask users for clarification when needed

Example: “Which ‘transformers’?” - AI models or electrical engineering?

🔒 Security Features

  • Roots: Filesystem boundaries
  • Sampling: Server can request LLM help
  • Scopes: Granular permissions

Key benefit: Human-in-the-loop workflows with graceful ambiguity handling

The Growing MCP Ecosystem

🛠️ Popular Categories

  • Developer Tools: GitHub, GitLab, Docker
  • Databases: PostgreSQL, Redis, Vector DBs
  • Communication: Slack, Gmail, Teams

🚀 What They Enable

  • Productivity: Google Drive, Notion, Zotero
  • Web Search: Brave, DuckDuckGo, Tavily
  • Aggregators: Zapier (1000s of integrations)

200+ servers and growing - Build once, use everywhere

Getting Started: Developer Resources

Essential Resources

  • Official Docs: modelcontextprotocol.io
  • Protocol Spec: Complete technical specification
  • SDKs: Python, TypeScript, Java, C#, Go
  • MCP Inspector: Interactive debugging tool

Learning & Community

  • DeepLearning.AI Course: Structured tutorials
  • awesome-mcp-servers: Curated examples
  • Community: Reddit r/mcp, Discord servers
  • Quick Start: Build your first server in minutes

Demo Time!

Let’s see our AI Research Assistant in action

  1. Search for papers on “transformer models”
  2. Download a specific paper
  3. Save it to Zotero library
  4. Generate a summary with progress tracking

The Future is Composable

MCP resolves the critical context gap

  • Universal language for AI integration
  • Composable agents working in concert
  • Network effects drive rapid ecosystem growth

Your Next Steps

  1. Identify a tool you use daily
  2. Build a simple MCP server for it
  3. Contribute to the growing ecosystem
  4. Unlock its potential for all AI applications

The time to start building is now.

Questions & Discussion

Thank you!

Resources

  • Demo Code: Available in this repository
  • Documentation: modelcontextprotocol.io
  • Community: Join the MCP ecosystem

Let’s build the future of AI together.